import type {
  GetCodeData,
  GetCodePrams,
  PostLoginData,
  PostLoginParams,
  PostLoginPasswordData,
  PostLoginPasswordParams,
} from '@/types/common'
import { request } from '@/utils/request'

/**
 * 登录--密码登录
 * @param data 手机号、密码
 * @returns
 */
export const postLoginPasswordAPI = (data: PostLoginPasswordParams) => {
  return request<PostLoginPasswordData>('/login/password', 'POST', data)
}

/**
 * 获取手机验证码
 * @param params 手机号、验证码类型
 * @returns
 */
export const getCodeAPI = (params: GetCodePrams) => {
  return request<GetCodeData>('/code', 'GET', params)
}
/**
 * 获取手机验证码
 * @param params 手机号
 * @returns
 */
export const getLoginAPI = (params: PostLoginParams) => {
  return request<PostLoginData>('/login', 'POST', params)
}
// 获取消息
export const getMessageAPI = () => {
  return request('/patient/message/unRead/all', 'GET')
}
